package com.xnew.provider;

import com.xnew.api.DatabaseInfoApi;
import com.xnew.model.params.DatabaseInfoParam;
import com.xnew.model.result.DatabaseInfoResult;
import com.xnew.service.DatabaseInfoService;
import com.xnewtech.xplatform.swan.model.page.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 数据库信息表服务提供者
 *
 * @author shj
 * @Date 2021-08-09 15:49:46
 */
@RestController
public class DatabaseInfoProvider implements DatabaseInfoApi {


    @Autowired
    private DatabaseInfoService databaseInfoService;

    /**
     * 新增
     *
     * @author shj
     * @Date 2021-08-09
     */
    @Override
    public void add(@RequestBody DatabaseInfoParam param) {
        databaseInfoService.add(param);
    }

    /**
     * 修改
     *
     * @author shj
     * @Date 2021-08-09
     */
    @Override
    public void delete(@RequestBody DatabaseInfoParam param) {
        databaseInfoService.delete(param);
    }

    /**
     * 删除
     *
     * @author shj
     * @Date 2021-08-09
     */
    @Override
    public void update(@RequestBody DatabaseInfoParam param) {
        databaseInfoService.update(param);
    }

    /**
     * 查询单条详情
     *
     * @author shj
     * @Date 2021-08-09
     */
    @Override
    public DatabaseInfoResult findBySpec(@RequestBody DatabaseInfoParam param) {
        return databaseInfoService.findBySpec(param);
    }

    /**
     * 查询列表
     *
     * @author shj
     * @Date 2021-08-09
     */
    @Override
    public List<DatabaseInfoResult> findListBySpec(@RequestBody DatabaseInfoParam param) {
        return databaseInfoService.findListBySpec(param);
    }

    /**
     * 分页查询列表
     *
     * @author shj
     * @Date 2021-08-09
     */
    @Override
    public PageResult<DatabaseInfoResult> findPageBySpec(@RequestBody DatabaseInfoParam param) {
        return databaseInfoService.findPageBySpec(param);
    }

}
